package net.comm.oper.db;


import java.sql.ResultSet;
import java.sql.SQLException;


import net.comm.oper.bean.Baseoperlog;
import net.comm.util.StringUtil;

import org.sakaiproject.db.api.SqlReader;

public class DbOperLogService implements SqlReader
{

	/**
	 * Read from the result one set of fields to create a Resource.
	 * 
	 * @param result
	 *        The Sql query result.
	 * @return The Resource object.
	 */
	public Object readSqlResultRecord(ResultSet result)
	{
		try
		{
			
			int  	operID = result.getInt(1);								//
			int  	userID = result.getInt(2);		//会员ID
			int  	type = result.getInt(3);			//操作类型
			String  content = StringUtil.getValue(result.getString(4));		//操作内容
			String  mtime = StringUtil.getValue(result.getString(5));				

			// create the Resource from these fields
			return new Baseoperlog( operID,  userID, type, content, mtime);
		}
		catch (SQLException e)
		{
			return null;
		}
		
	}
}
